1. Field of the Invention
The present invention relates to image processing devices, image processing methods, and image reading methods, and, more particularly, to an image processing device, an image processing method, and an image reading method that conform to JPEG-2000.
2. Description of the Related Art
In recent years, “JPEG-2000” has been standardized as the next-generation international standard still-image compression method.
The “JPEG-2000” is a compression method developed to follow “JPEG (Joint Photographic Experts Group)”, which is currently the mainstream as a still-image compression technique for forming images suitable for the Internet and digital still cameras. Currently, the part specifying the data compression technique in the “JPEG”, which is referred to as “Part-1”, is considered to be the international standard.
The compression method according to the JPEG-2000 differs greatly from that according to the current JPEG in that wavelet transforms are employed. FIG. 2 illustrates a general encoding-decoding operation in accordance with the JPEG-2000 employing the wavelet transforms.
In the structure shown in FIG. 2, image data input through the left side is encoded and output through the right side, and encoded data input through the right side is decoded and output through the left side.
More specifically, a color converter 10 color-converts input image data. For example, image data input in the form of RGB (R represents red, G represents green, and B represents blue) is converted into the form of YCbCr (Y represents brightness, and Cb and Cr represents color differences), and vice versa. In the following, a set of expressions (1) that can be applied to a color conversion of RGB image data is shown as an example.G=Yr−(Cr+Cb−2)/4 Y=(R+2G+B)/4R=Cr+G Cr=R−GB=Cb+G Cb=B−G  (1)
However, the color converter 10 is not necessarily included in the structure shown in FIG. 2, and functions only if necessary.
In the structure shown in FIG. 2, a wavelet transform unit 20 performs a plural-level two-dimensional discrete wavelet transform (DWT) on the components of the image data separately from one another. At this stage, the two-dimensional discrete wavelet transform can be performed by dividing the image to be processed into a plurality of rectangular blocks called tiles. In this case of dividing the image into a plurality of tiles, the wavelet transform unit 20, a quantizer 30, and an entropy encoder 60 carry out each process for each tile.
A Case of Performing Wavelet Transforms on Components that have not Been Sub-Sampled
In the following, a case where image data made up of three components (Component 0 is Y, Component 1 is Cb, and Component 2 is Cr, for example) that have not been sub-sampled are divided into tiles each consisting of 128×128 pixels and then subjected to a level-3 two-dimensional discrete wavelet transform will be described by way of examples.
An integer discrete wavelet transform that is a reversible one of the wavelet transforms employed in the JPEG-2000 can be represented by the following set of expressions (2):L(k)=x(2k)+[H(k)+H(k+1)]/4H(k)=x(2k−1)−[x(2k)+(2k−2)]/2  (2)
In the above expressions, x(k) represents the pixel value at a point k (i.e., a pixel k on a tile). Also, L represents smoothing, and H represents edge detection.
When a two-dimensional discrete wavelet transform of 3 levels is performed in accordance with the above set of expressions (2), the data of each of the three components described above are converted into coefficient data consisting of 10 sub-bands, as shown in FIG. 4. Further, FIG. 8 shows the structure of a component that has been converted into coefficient data consisting of 10 sub-bands (3LL, 3HL, 3HH, 3LH, 2HL, 2LH, 2HH, 1HL, 1LH, and 1HH). Taking an example from the sub-bands, “3HL” represents a sub-band that is obtained by high-pass filtering (“H”) horizontal pixels and low-pass filtering (“L”) vertical pixels in stage 3.
In the above manner, each of the three components is converted into coefficient data consisting of a plurality of sub-bands corresponding to the number of levels. If necessary, each tile of the obtained coefficient data is separately quantized by the quantizer 30, and is then subjected to entropy encoding by the entropy encoder 60.
Here, the entropy encoding is an encoding process including the steps of dividing each piece of coefficient data into bit planes, and encoding the bit data existing in each bit plane with a binary arithmetic encoder (or an MQ encoder).
To achieve reversible encoding, i.e., encoding without image deterioration due to compression in this structure, it is necessary to encode all the bit planes of each sub-band. In doing so, the lower bit planes of each sub-band can be discarded in the encoding process so as to increase the compression ratio.
The increasing of the compression ratio by discarding lower bit planes is called “truncation”, which helps to obtain an optimum image quality at a predetermined compression ratio by selectively discarding bit planes of sub-bands that have less influence on the image quality of a decoded image.
A Case of Performing Wavelet Transforms on Sub-Sampled Components
In the following, a case where sub-sampled image data having color difference signals are encoded will be described.
FIG. 3 shows the pixel ratio in each input-output format in the x-direction (the horizontal direction) and the y-direction (the vertical direction). Here, it should be noted that the structure shown in FIG. 3 is designed to illustrate the pixel ratio in each of the input-output formats in the x-direction and the y-direction, and does not represent the actual minimum unit number of pixels in this conventional wavelet transform.
In FIG. 3, the components 1 and 2 in each format of 4:2:2 (the rate of the horizontal pixels H is 2, and the rate of the vertical pixels V is 1; hereinafter represented as “H2V1”), 4:2:2 (H1V2), and 4:1:1 (H1V1), have been sub-sampled in the previous process stage.
In the format of 4:2:2 (H2V1), for instance, the components have been sub-sampled in the x-direction, i.e., the data in the x-direction have been thinned and sub-sampled. Likewise, in the format of 4:2:2 (H1V2), the data in the y-direction have been thinned, and, in the format of 4:1:1 (H1V1) the data in both x-direction and y-direction have been sub-sampled (or thinned).
FIG. 9 shows the wavelet coefficient of each component in a case where a two-dimensional discrete wavelet transform of 3 levels is performed on image data in the format of 4:2:2 (H2V1).
As shown in FIG. 9, in the case of a tile consisting of 128×128 pixels, the data region of each of the sub-sampled components 1 and 2 contains 64×128 pixels, as the x-direction thinning has been carried out.
When a two-dimensional discrete wavelet transform of 3 levels is performed on the data in this region, the resultant sub-bands have the horizontal pixels that are a half of the vertical pixels as shown in FIG. 10, and differ from the sub-bands of a component that has not been sub-sampled (see FIG. 8).
As described above, when a two-dimensional discrete wavelet transform is performed on data that have been thinned in the x-direction and/or the y-direction, the configurations of the sub-bands differ among components.
For this reason, when entropy encoding is carried out by dividing each sub-band into bit planes, there is a need to perform a control operation depending upon the existing differences, such as interpolating “0” into pixels or interpolating a value corresponding to the previous pixel for the sub-sampled bit planes into pixels. As a result, the circuit of the entropy encoder 60 becomes completed.
Furthermore, the interpolation causes an increase in the data by an amount equivalent to the interpolation, resulting in an increase in the total amount of data to be processed